export default function updater(state,action){
    switch(action.type){
        case 'select':
            let list = state.list.slice();
            for(let i=0;i<list.length; i++){
                let item = list[i];
                if(item.id===action.id){
                    item.selected = !item.selected;
                }
            }
            return Object.assign({},state,{list});
            break;
        default:
            return state;
    }
}
